{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import scanpy as sc\n",
    "import numpy as np\n",
    "from scipy import sparse\n",
    "import loompy as lp\n",
    "from loomxpy._loomx import LoomX\n",
    "from loomxpy._io._read import read_loom"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Read (LoomX)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "file_path = '../data/10x_rna.loom'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding data matrix...\n",
      "INFO: adding new rna mode\n",
      "Adding annotations...\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "The key 'leiden_res0.9' won't be accessible using the dot notation (containing special characters other than '_')\n",
      "Converting leiden_res0.9 annotation to categorical type...\n",
      "The key 'leiden_res0.3' won't be accessible using the dot notation (containing special characters other than '_')\n",
      "Converting leiden_res0.3 annotation to categorical type...\n",
      "The key 'leiden_res1.2' won't be accessible using the dot notation (containing special characters other than '_')\n",
      "Converting leiden_res1.2 annotation to categorical type...\n",
      "The key 'leiden_res0.6' won't be accessible using the dot notation (containing special characters other than '_')\n",
      "Converting leiden_res0.6 annotation to categorical type...\n",
      "Converting cell_type annotation to categorical type...\n",
      "Converting sample_id annotation to categorical type...\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding metrics...\n",
      "Adding embeddings...\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "The key 'HVG UMAP' won't be accessible using the dot notation (containing special characters other than '_')\n",
      "The key 'HVG t-SNE' won't be accessible using the dot notation (containing special characters other than '_')\n",
      "The key 'HVG PC1/PC2' won't be accessible using the dot notation (containing special characters other than '_')\n",
      "The key 'SCENIC AUC UMAP' won't be accessible using the dot notation (containing special characters other than '_')\n",
      "The key 'SCENIC AUC t-SNE' won't be accessible using the dot notation (containing special characters other than '_')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding clusterings...\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "The key 'Leiden resolution 0.9' won't be accessible using the dot notation (containing special characters other than '_')\n",
      "The key 'Leiden resolution 0.3' won't be accessible using the dot notation (containing special characters other than '_')\n",
      "The key 'Leiden resolution 1.2' won't be accessible using the dot notation (containing special characters other than '_')\n",
      "The key 'Leiden resolution 0.6' won't be accessible using the dot notation (containing special characters other than '_')\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding global attributes...\n"
     ]
    }
   ],
   "source": [
    "lx = read_loom(\n",
    "    file_path=file_path,\n",
    "    force_conversion={\"annotations\": True}\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Explore"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CreationDate\n",
      "Genome\n",
      "LOOM_SPEC_VERSION\n",
      "SCopeTreeL1\n",
      "SCopeTreeL2\n",
      "SCopeTreeL3\n"
     ]
    }
   ],
   "source": [
    "for k,v in lx.modes.rna.g.keys():\n",
    "    print(k)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'3.0.0'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lx.modes.rna.g.LOOM_SPEC_VERSION"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "for k,v in lx.modes.rna.f.keys():\n",
    "    print(k)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "leiden_res0.9\n",
      "leiden_res0.3\n",
      "leiden_res1.2\n",
      "leiden_res0.6\n",
      "cell_type\n",
      "sample_id\n",
      "nGene\n",
      "nUMI\n",
      "n_counts\n",
      "n_genes\n",
      "percent_mito\n",
      "HVG UMAP\n",
      "HVG t-SNE\n",
      "HVG PC1/PC2\n",
      "SCENIC AUC UMAP\n",
      "SCENIC AUC t-SNE\n",
      "Leiden resolution 0.9\n",
      "Leiden resolution 0.3\n",
      "Leiden resolution 1.2\n",
      "Leiden resolution 0.6\n"
     ]
    }
   ],
   "source": [
    "# Explore all available data regarding the observations (i.e.: cells)\n",
    "for k,v in lx.modes.rna.o.keys():\n",
    "    print(k)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Annotations"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "leiden_res0.9\n",
      "leiden_res0.3\n",
      "leiden_res1.2\n",
      "leiden_res0.6\n",
      "cell_type\n",
      "sample_id\n"
     ]
    }
   ],
   "source": [
    "for k,v in lx.modes.rna.o.annotations:\n",
    "    print(k)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "AAACAGCCATTATGCG-1-10x_multiome_brain        MOL\n",
       "AAACCAACATAGACCC-1-10x_multiome_brain        MOL\n",
       "AAACCGAAGATGCCTG-1-10x_multiome_brain    INH_VIP\n",
       "AAACCGAAGTTAGCTA-1-10x_multiome_brain       NFOL\n",
       "AAACCGCGTCTTACTA-1-10x_multiome_brain        MOL\n",
       "                                          ...   \n",
       "TTTGTGAAGGGTGAGT-1-10x_multiome_brain    INH_VIP\n",
       "TTTGTGAAGTCAGGCC-1-10x_multiome_brain    AST_CER\n",
       "TTTGTGGCATGCTTAG-1-10x_multiome_brain        MOL\n",
       "TTTGTTGGTGATCAGC-1-10x_multiome_brain       NFOL\n",
       "TTTGTTGGTGATTTGG-1-10x_multiome_brain    INH_SST\n",
       "Name: cell_type, Length: 2607, dtype: category\n",
       "Categories (14, object): ['AST', 'ASTP', 'AST_CER', 'ENDO', ..., 'MOL', 'NFOL', 'OPC', 'PURK']"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lx.modes.rna.o.annotations[\"cell_type\"]\n",
    "# Can also be accessed using:\n",
    "# lx.modes.rna.o[\"cell_type\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Metrics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "nGene\n",
      "nUMI\n",
      "n_counts\n",
      "n_genes\n",
      "percent_mito\n"
     ]
    }
   ],
   "source": [
    "for k,v in lx.modes.rna.o.metrics:\n",
    "    print(k)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "AAACAGCCATTATGCG-1-10x_multiome_brain    10006.0\n",
       "AAACCAACATAGACCC-1-10x_multiome_brain     6016.0\n",
       "AAACCGAAGATGCCTG-1-10x_multiome_brain    15267.0\n",
       "AAACCGAAGTTAGCTA-1-10x_multiome_brain     6996.0\n",
       "AAACCGCGTCTTACTA-1-10x_multiome_brain     2059.0\n",
       "                                          ...   \n",
       "TTTGTGAAGGGTGAGT-1-10x_multiome_brain     1102.0\n",
       "TTTGTGAAGTCAGGCC-1-10x_multiome_brain     6614.0\n",
       "TTTGTGGCATGCTTAG-1-10x_multiome_brain    12456.0\n",
       "TTTGTTGGTGATCAGC-1-10x_multiome_brain     7460.0\n",
       "TTTGTTGGTGATTTGG-1-10x_multiome_brain     2221.0\n",
       "Name: n_counts, Length: 2607, dtype: float32"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lx.modes.rna.o.metrics[\"n_counts\"]\n",
    "# Can also be accessed using:\n",
    "# lx.modes.rna.o[\"n_counts\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Embeddings"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "HVG UMAP\n",
      "HVG t-SNE\n",
      "HVG PC1/PC2\n",
      "SCENIC AUC UMAP\n",
      "SCENIC AUC t-SNE\n"
     ]
    }
   ],
   "source": [
    "for k,v in lx.modes.rna.o.embeddings:\n",
    "    print(k)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>_X</th>\n",
       "      <th>_Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>AAACAGCCATTATGCG-1-10x_multiome_brain</th>\n",
       "      <td>11.866692</td>\n",
       "      <td>6.071897</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAACCAACATAGACCC-1-10x_multiome_brain</th>\n",
       "      <td>11.540525</td>\n",
       "      <td>3.874464</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAACCGAAGATGCCTG-1-10x_multiome_brain</th>\n",
       "      <td>-5.994763</td>\n",
       "      <td>7.198971</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAACCGAAGTTAGCTA-1-10x_multiome_brain</th>\n",
       "      <td>12.658012</td>\n",
       "      <td>5.963271</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAACCGCGTCTTACTA-1-10x_multiome_brain</th>\n",
       "      <td>10.451440</td>\n",
       "      <td>4.170816</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TTTGTGAAGGGTGAGT-1-10x_multiome_brain</th>\n",
       "      <td>-4.442218</td>\n",
       "      <td>5.991313</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TTTGTGAAGTCAGGCC-1-10x_multiome_brain</th>\n",
       "      <td>-0.537465</td>\n",
       "      <td>-3.767715</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TTTGTGGCATGCTTAG-1-10x_multiome_brain</th>\n",
       "      <td>12.732769</td>\n",
       "      <td>2.572658</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TTTGTTGGTGATCAGC-1-10x_multiome_brain</th>\n",
       "      <td>11.358409</td>\n",
       "      <td>3.532379</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>TTTGTTGGTGATTTGG-1-10x_multiome_brain</th>\n",
       "      <td>-2.012947</td>\n",
       "      <td>10.341680</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2607 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                              _X         _Y\n",
       "AAACAGCCATTATGCG-1-10x_multiome_brain  11.866692   6.071897\n",
       "AAACCAACATAGACCC-1-10x_multiome_brain  11.540525   3.874464\n",
       "AAACCGAAGATGCCTG-1-10x_multiome_brain  -5.994763   7.198971\n",
       "AAACCGAAGTTAGCTA-1-10x_multiome_brain  12.658012   5.963271\n",
       "AAACCGCGTCTTACTA-1-10x_multiome_brain  10.451440   4.170816\n",
       "...                                          ...        ...\n",
       "TTTGTGAAGGGTGAGT-1-10x_multiome_brain  -4.442218   5.991313\n",
       "TTTGTGAAGTCAGGCC-1-10x_multiome_brain  -0.537465  -3.767715\n",
       "TTTGTGGCATGCTTAG-1-10x_multiome_brain  12.732769   2.572658\n",
       "TTTGTTGGTGATCAGC-1-10x_multiome_brain  11.358409   3.532379\n",
       "TTTGTTGGTGATTTGG-1-10x_multiome_brain  -2.012947  10.341680\n",
       "\n",
       "[2607 rows x 2 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lx.modes.rna.o.embeddings[\"SCENIC AUC UMAP\"]\n",
    "# Can also be accessed using:\n",
    "# lx.modes.rna.o[\"SCENIC AUC UMAP\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Clustering"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Leiden resolution 0.9\n",
      "Leiden resolution 0.3\n",
      "Leiden resolution 1.2\n",
      "Leiden resolution 0.6\n"
     ]
    }
   ],
   "source": [
    "for k,v in lx.modes.rna.o.clusterings:\n",
    "    print(k)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\n",
       "\n",
       "key: Leiden resolution 0.3\n",
       "mode: ModeType.RNA\n",
       "type: AttributeType.CLUSTERING\n",
       "name: Leiden resolution 0.3\n",
       "description: None\n",
       "        \n",
       "number of clusters: 12\n",
       "        "
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Summary of given clustering\n",
    "lx.modes.rna.o.clusterings.get_attribute(\"Leiden resolution 0.3\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>cluster</th>\n",
       "      <th>avg_logFC</th>\n",
       "      <th>pval</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>index</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>AACS</th>\n",
       "      <td>0</td>\n",
       "      <td>-1.214017</td>\n",
       "      <td>1.755964e-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAGAB</th>\n",
       "      <td>0</td>\n",
       "      <td>-0.269014</td>\n",
       "      <td>1.739026e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAK1</th>\n",
       "      <td>0</td>\n",
       "      <td>-1.092985</td>\n",
       "      <td>1.650032e-30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AARSD1</th>\n",
       "      <td>0</td>\n",
       "      <td>-0.864859</td>\n",
       "      <td>1.543590e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AASDH</th>\n",
       "      <td>0</td>\n",
       "      <td>-0.709720</td>\n",
       "      <td>1.375027e-04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ZNF708</th>\n",
       "      <td>11</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ZNF98</th>\n",
       "      <td>11</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ZNRD1</th>\n",
       "      <td>11</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ZNRF3</th>\n",
       "      <td>11</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ZSWIM6</th>\n",
       "      <td>11</td>\n",
       "      <td>-4.058122</td>\n",
       "      <td>4.344405e-08</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>47860 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       cluster  avg_logFC          pval\n",
       "index                                  \n",
       "AACS         0  -1.214017  1.755964e-06\n",
       "AAGAB        0  -0.269014  1.739026e-02\n",
       "AAK1         0  -1.092985  1.650032e-30\n",
       "AARSD1       0  -0.864859  1.543590e-02\n",
       "AASDH        0  -0.709720  1.375027e-04\n",
       "...        ...        ...           ...\n",
       "ZNF708      11   0.000000  0.000000e+00\n",
       "ZNF98       11   0.000000  0.000000e+00\n",
       "ZNRD1       11   0.000000  0.000000e+00\n",
       "ZNRF3       11   0.000000  0.000000e+00\n",
       "ZSWIM6      11  -4.058122  4.344405e-08\n",
       "\n",
       "[47860 rows x 3 columns]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Get markers of all clusters of given clustering\n",
    "lx.modes.rna.o.clusterings.get_attribute(\"Leiden resolution 0.3\").markers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0: MOL (0)\n",
      "1: NFOL (1)\n",
      "2: AST_CER (2)\n",
      "3: OPC (3)\n",
      "4: GC (4)\n",
      "5: INH_SST (5)\n",
      "6: INH_VIP (6)\n",
      "7: MGL (7)\n",
      "8: GP (8)\n",
      "9: AST+ENDO (9)\n",
      "10: PURK (10)\n",
      "11: INH_PVALB (11)\n"
     ]
    }
   ],
   "source": [
    "# Get all markers of a cluster from a clustering\n",
    "for k,v in lx.modes.rna.o.clusterings.get_attribute(\"Leiden resolution 0.3\"):\n",
    "    print(f\"{k}: {v.description}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>cluster</th>\n",
       "      <th>avg_logFC</th>\n",
       "      <th>pval</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>index</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>AACS</th>\n",
       "      <td>0</td>\n",
       "      <td>-1.214017</td>\n",
       "      <td>1.755964e-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAGAB</th>\n",
       "      <td>0</td>\n",
       "      <td>-0.269014</td>\n",
       "      <td>1.739026e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AAK1</th>\n",
       "      <td>0</td>\n",
       "      <td>-1.092985</td>\n",
       "      <td>1.650032e-30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AARSD1</th>\n",
       "      <td>0</td>\n",
       "      <td>-0.864859</td>\n",
       "      <td>1.543590e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AASDH</th>\n",
       "      <td>0</td>\n",
       "      <td>-0.709720</td>\n",
       "      <td>1.375027e-04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ZRANB3</th>\n",
       "      <td>0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ZSCAN23</th>\n",
       "      <td>0</td>\n",
       "      <td>-1.135173</td>\n",
       "      <td>1.859158e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ZSCAN5A</th>\n",
       "      <td>0</td>\n",
       "      <td>-0.592134</td>\n",
       "      <td>5.246708e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ZSWIM5</th>\n",
       "      <td>0</td>\n",
       "      <td>-0.276347</td>\n",
       "      <td>5.657378e-04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ZYG11B</th>\n",
       "      <td>0</td>\n",
       "      <td>-0.272697</td>\n",
       "      <td>9.745587e-03</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5409 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        cluster  avg_logFC          pval\n",
       "index                                   \n",
       "AACS          0  -1.214017  1.755964e-06\n",
       "AAGAB         0  -0.269014  1.739026e-02\n",
       "AAK1          0  -1.092985  1.650032e-30\n",
       "AARSD1        0  -0.864859  1.543590e-02\n",
       "AASDH         0  -0.709720  1.375027e-04\n",
       "...         ...        ...           ...\n",
       "ZRANB3        0   0.000000  0.000000e+00\n",
       "ZSCAN23       0  -1.135173  1.859158e-02\n",
       "ZSCAN5A       0  -0.592134  5.246708e-05\n",
       "ZSWIM5        0  -0.276347  5.657378e-04\n",
       "ZYG11B        0  -0.272697  9.745587e-03\n",
       "\n",
       "[5409 rows x 3 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lx.modes.rna.o.clusterings.get_attribute(\"Leiden resolution 0.3\").clusters[0].markers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.7 - Single-Cell Multiome",
   "language": "python",
   "name": "single-cell-multiome"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
